package org.star.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author : 一叶浮萍归大海
 * @Date: 2024/6/11 17:35
 * @Description:
 */
@Slf4j
@RequestMapping("/order")
@RestController
public class OrderController11000 {

    @Resource
    private RestTemplate restTemplate;

    public static final String INVOKE_URL = "http://stockService/stock/reduceStock";

    @GetMapping("/placingOrder")
    public String placingOrder() {
        log.info("下单成功!");
        String result = restTemplate.getForObject(INVOKE_URL, String.class);
        log.info("result:{}", result);
        return "下单成功********O(∩_∩)O";
    }

}
